package org.hzero.order.app.service.impl;

import java.util.Map;

import com.baidu.unbiz.fluentvalidator.ValidatorContext;
import com.baidu.unbiz.fluentvalidator.ValidatorHandler;
import org.hzero.boot.imported.infra.constant.HimpBootConstants;
import org.hzero.boot.imported.infra.validator.annotation.ImportValidators;
import org.hzero.order.infra.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author xiuiqng.Yang-Estelle-양수청
 * @date 2019/8/6 16:03
 */
@ImportValidators({
        @org.hzero.boot.imported.infra.validator.annotation.ImportValidator(templateCode = "IMPORT-VALIDATE")
})
public class ImportValidator extends ValidatorHandler<String> {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean validate(ValidatorContext context, String data) {
        // 获取自定义参数
        Map args = context.getAttribute(HimpBootConstants.ARGS, Map.class);

        // do something
        return true;
    }

}
